<?php


namespace App\Services;



class WechatService
{

    public static function app()
    {
        $app = app('wechat.official_account');
        return $app;

    }
    public static function sendMsg($data)
    {
        $app = self::app();
        return
            $app->template_message->send([
            'touser' => 'oDu_01GBangbOYMWdDVAHxdRBZqc',
            'template_id' => 'ix7QDEIK7YbcI3Wrc1hxVBHOELtiFkO6iRWwypCCH_c',
            'url' => 'https://www.duozhuayu.com/cart',
            'data' => $data
    ]);
    }
  
	public static function test() {
		$user = "oDu_01D50mstkCjFJsEPTskdrqAI";
		$data = ['title' => "test", 'price' => "22.5", 'link' => "https://www.duozhuayu.com/cart"];
		$app = self::app();
		return
		$app->template_message->send([
			'touser' => $user,
			'template_id' => 'ix7QDEIK7YbcI3Wrc1hxVBHOELtiFkO6iRWwypCCH_c',
			'url' => 'https://www.duozhuayu.com/cart',
			'data' => $data,
		]);

	}
}
